package xin.marcher.module.trace.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TraceDataDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 一条记录所有的字段以及值
     */
    private List<FieldInfo> fieldInfos;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class FieldInfo implements Serializable {

        private static final long serialVersionUID = 1L;

        /**
         * 字段名
         */
        private String fieldName;

        /**
         * 字段当前的值
         */
        private Object fieldValue;

        /**
         * 字段旧的值
         */
        private Object oldValue;

        /**
         * 字段的值是否发生变化
         */
        private boolean changed;
    }
}
